//
//  UIFont+ATKit.m
//  FDLive
//
//  Created by CoderLT on 2017/7/10.
//  Copyright © 2017年 FDLive. All rights reserved.
//

#import "UIFont+ATKit.h"

@implementation UIFont (ATKit)

- (instancetype)monoSpaceFont {
    UIFontDescriptor *const existingDescriptor = [self fontDescriptor];
    NSDictionary *const fontAttributes = @{ UIFontDescriptorFeatureSettingsAttribute: @[
                                                    @{ UIFontFeatureTypeIdentifierKey: @(kNumberSpacingType),
                                                       UIFontFeatureSelectorIdentifierKey: @(kMonospacedNumbersSelector)
                                                       }]
                                            };
    UIFontDescriptor *const proportionalDescriptor = [existingDescriptor fontDescriptorByAddingAttributes: fontAttributes];
    return [UIFont fontWithDescriptor:proportionalDescriptor size:[self pointSize]];
}
@end
